SetData Method

The SetData procedure method allows you to programatically replace a graphic's existing data with the specified data. When the SetData method is called, the graphic window is immediately updated to display the new data.

Coordinate Systems

For the Arrow, Polygon, Polyline, and Symbol graphics, if the graphic is created in data coordinates (with the DATA keyword), then data coordinates should be supplied to the SetData method. If the graphic is created in device coordinates (with the DEVICE keyword) or normalized coordinates (with the NORMAL keyword, the default value for creation), then normalized coordinates should be supplied to the SetData method. The ConvertCoord Method may be used to convert values from one coordinate system to another.

Example

TEMP1=RANDOMU(SEED,12) * 100

TEMP2=RANDOMU(SEED,12) * 100

DAY=FINDGEN(12) * 30 + 15

 

p = PLOT(DAY, TEMP1, 'Db-1', $

TITLE = 'Temperature', $

XTITLE = 'Day of Year', $

YTITLE = 'Degrees Fahrenheit')

 

p.SetData, DAY, TEMP2

Syntax

graphic.SetData, Argument1, Argument2, ... Argumentn [, CONNECTIVITY=value] [, /ORDER]

The arguments to the SetData method should be specified in the same manner as the function call used to create the graphic.

Arguments

The input arguments depend on the graphic being modified and the number of arguments supplied. The form of the arguments is similar to the arguments supplied for the creation of the graphic.

Graphic

1 Arg

2 Args

3 Args

4 Args

Keywords

Coordinates

Arrow

 

X, Y

 

 

 

NORMAL unless created with /DATA

Barplot

Y

X, Y

 

 

 

DATA

Boxplot

Values

Locations, Values

 

 

 

DATA

Bubbleplot

 

X, Y

 

 

 

DATA

Contour

Z

 

Z, X, Y

 

 

DATA

Errorplot

 

Y, Yerror

X, Y, Yerror

X, Y, Xerror, Yerror

 

DATA

Fillplot Y X, Y       DATA

Image

Image

 

Image, X, Y

 

ORDER

DATA

Plot3D

 

 

X, Y, Z

 

 

DATA

Plot

Y

X, Y

 

 

 

DATA

Polarplot

Theta

R, Theta

 

 

 

DATA

Polygon

 

X, Y

X, Y, Z

 

CONNECTIVITY

NORMAL unless created with /DATA

Polyline

 

X, Y

X, Y, Z

 

CONNECTIVITY

NORMAL unless created with /DATA

Scatterplot

 

X, Y

 

 

 

DATA

Scatterplot3D

 

 

X, Y, Z

 

 

DATA

Streamline

 

U, V

 

U, V, X, Y

 

DATA

Surface

Z

 

Z, X, Y

 

 

DATA

Symbol

 

X, Y

 

 

 

NORMAL unless created with /DATA

Vector

 

U, V

 

U, V, X, Y

 

DATA

Volume

Vol0

Vol0, Vol1

 

Vol0, Vol1, Vol2, Vol3

 

DATA

Keywords

CONNECTIVITY

This keyword applies only to the POLYLINE and POLYGON graphics, and is identical to the CONNECTIVITY keyword for the POLYLINE and POLYGON functions.

ORDER

This keyword applies only to an IMAGE graphic. Set this keyword to force the rows of the image data to be drawn from top to bottom. By default, image data is drawn from the bottom row up to the top row.

Version History

8.1

Introduced

See Also

Save Method, Refresh Method, GetData Method